import datetime
import time

def metric(fn):
    def run_time():
        start_t = time.time()
        print(start_t)
        fn()
        end_t = time.time()
        print(end_t)
        run_t=end_t-start_t
        print(run_t)
        print('%s执行了%f秒' % (fn.__name__,run_t))
    return run_time
@ metric

def run():
    time.sleep(1)
    l = [x**2 for x in range(100000)]
run()